package com.tledu.equipment.service.impl;

import com.tledu.common.utils.DateUtils;
import com.tledu.equipment.domain.EquipmentLog;
import com.tledu.equipment.mapper.EquipmentLogMapper;
import com.tledu.equipment.service.IEquipmentLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 操作日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-29
 */
@Service
public class EquipmentLogServiceImpl implements IEquipmentLogService 
{
    @Autowired
    private EquipmentLogMapper equipmentLogMapper;

    /**
     * 查询操作日志
     * 
     * @param id 操作日志主键
     * @return 操作日志
     */
    @Override
    public EquipmentLog selectEquipmentLogById(Long id)
    {
        return equipmentLogMapper.selectEquipmentLogById(id);
    }

    /**
     * 查询操作日志列表
     * 
     * @param equipmentLog 操作日志
     * @return 操作日志
     */
    @Override
    public List<EquipmentLog> selectEquipmentLogList(EquipmentLog equipmentLog)
    {
        return equipmentLogMapper.selectEquipmentLogList(equipmentLog);
    }



    /**
     * 新增操作日志
     * 
     * @param equipmentLog 操作日志
     * @return 结果
     */
    @Override
    public int insertEquipmentLog(EquipmentLog equipmentLog)
    {
        equipmentLog.setCreateTime(DateUtils.getNowDate());
        return equipmentLogMapper.insertEquipmentLog(equipmentLog);
    }

    /**
     * 修改操作日志
     * 
     * @param equipmentLog 操作日志
     * @return 结果
     */
    @Override
    public int updateEquipmentLog(EquipmentLog equipmentLog)
    {
        return equipmentLogMapper.updateEquipmentLog(equipmentLog);
    }

    /**
     * 批量删除操作日志
     * 
     * @param ids 需要删除的操作日志主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentLogByIds(Long[] ids)
    {
        return equipmentLogMapper.deleteEquipmentLogByIds(ids);
    }



    /**
     * 删除操作日志信息
     * 
     * @param id 操作日志主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentLogById(Long id)
    {
        return equipmentLogMapper.deleteEquipmentLogById(id);
    }

    //逻辑删除
    public int LogicDeleteEquipmentLogByIds(Long[] ids) {
        return equipmentLogMapper.logicDeleteEquipmentLogById(ids);
    }
}
